From 0a2c247e8575438e0477e626fd123a5547289179 Mon Sep 17 00:00:00 2001 From: PJ Quirk Date: Wed, 20 Nov 2024 15:49:48 -0500 Subject: [PATCH] Fixing a code sample to use an updated API version (#53214) Co-authored-by: Joe Clark <31087804+jc-clark@users.noreply.github.com> --- .../actions/azure-vnet-configure-azure-resources-script.md | 3 ++- data/reusables/actions/azure-vnet-deleting-a-subnet.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/data/reusables/actions/azure-vnet-configure-azure-resources-script.md b/data/reusables/actions/azure-vnet-configure-azure-resources-script.md index 2fb6fbd673..78f71e05d2 100644 --- a/data/reusables/actions/azure-vnet-configure-azure-resources-script.md +++ b/data/reusables/actions/azure-vnet-configure-azure-resources-script.md @@ -35,6 +35,7 @@ export SUBNET_NAME=YOUR_SUBNET_NAME export NSG_NAME=YOUR_NSG_NAME export NETWORK_SETTINGS_RESOURCE_NAME=YOUR_NETWORK_SETTINGS_RESOURCE_NAME export DATABASE_ID=YOUR_DATABASE_ID +export API_VERSION=2024-04-02 # These are the default values. You can adjust your address and subnet prefixes. export ADDRESS_PREFIX=10.0.0.0/16 @@ -70,7 +71,7 @@ echo Delegate subnet to GitHub.Network/networkSettings and apply NSG rules echo echo Create network settings resource $NETWORK_SETTINGS_RESOURCE_NAME -. az resource create --resource-group $RESOURCE_GROUP_NAME --name $NETWORK_SETTINGS_RESOURCE_NAME --resource-type GitHub.Network/networkSettings --properties "{ \"location\": \"$AZURE_LOCATION\", \"properties\" : { \"subnetId\": \"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP_NAME/providers/Microsoft.Network/virtualNetworks/$VNET_NAME/subnets/$SUBNET_NAME\", \"businessId\": \"$DATABASE_ID\" }}" --is-full-object --output table --query "{GitHubId:tags.GitHubId, name:name}" --api-version 2024-04-02 +. az resource create --resource-group $RESOURCE_GROUP_NAME --name $NETWORK_SETTINGS_RESOURCE_NAME --resource-type GitHub.Network/networkSettings --properties "{ \"location\": \"$AZURE_LOCATION\", \"properties\" : { \"subnetId\": \"/subscriptions/$SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP_NAME/providers/Microsoft.Network/virtualNetworks/$VNET_NAME/subnets/$SUBNET_NAME\", \"businessId\": \"$DATABASE_ID\" }}" --is-full-object --output table --query "{GitHubId:tags.GitHubId, name:name}" --api-version $API_VERSION echo echo To clean up and delete resources run the following command: diff --git a/data/reusables/actions/azure-vnet-deleting-a-subnet.md b/data/reusables/actions/azure-vnet-deleting-a-subnet.md index 936b6e49fb..f6e4abef98 100644 --- a/data/reusables/actions/azure-vnet-deleting-a-subnet.md +++ b/data/reusables/actions/azure-vnet-deleting-a-subnet.md @@ -19,7 +19,7 @@ To delete the network settings resource, the network configuration that uses it ```bash copy az account set --subscription $SUBSCRIPTION_ID - az resource delete -g $RESOURCE_GROUP_NAME --name $NETWORK_SETTINGS_RESOURCE_NAME --resource-type 'GitHub.Network/networkSettings' --api-version '2023-11-01-preview' + az resource delete -g $RESOURCE_GROUP_NAME --name $NETWORK_SETTINGS_RESOURCE_NAME --resource-type 'GitHub.Network/networkSettings' --api-version $API_VERSION ``` 1. Delete the subnet in Azure. For more information, see [Delete a subnet](https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-manage-subnet?tabs=azure-portal#delete-a-subnet) on Microsoft Learn.