Created
May 29, 2018 01:26
-
-
Save DataSic/82c65d1785b0545ea7c4d1ba210e35ac to your computer and use it in GitHub Desktop.
CosmosDB - Add Firewall Rule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
https://docs.microsoft.com/en-us/azure/templates/microsoft.documentdb/databaseaccounts | |
#> | |
# Init variables | |
$resourceGroupName = "ResourceGroupName" | |
$resourceType = "Microsoft.DocumentDB/databaseAccounts" | |
$apiVersion = "2015-04-08" | |
$cosmosDbAccountName = "CosmosDbAccountName" | |
$propertyObject = @{"databaseAccountOfferType"="Standard"; | |
"ipRangeFilter"="IpAddress1,IpAddress2";} | |
# Update firewall rules | |
$setAzureRmResourceSplat = @{ | |
ResourceType = $resourceType | |
ApiVersion = $apiVersion | |
PropertyObject = $propertyObject | |
Name = $cosmosDbAccountName | |
ResourceGroupName = $resourceGroupName | |
Force = $true | |
} | |
Set-AzureRmResource @setAzureRmResourceSplat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment