mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Change API for RoleAssignments
This commit is contained in:
@@ -29,7 +29,7 @@ You also need to make sure the following software is installed on your machine:
|
||||
|
||||
1. PowerShell modules:
|
||||
|
||||
1. Az version 7.1.0 or later. For details on how to install the Az PowerShell module, see [Install the Azure Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps). To determine the version of the Az module installed on your machine, run the following command from a PowerShell session.
|
||||
1. Az version 7.2.1 or later. For details on how to install the Az PowerShell module, see [Install the Azure Az PowerShell module](https://docs.microsoft.com/powershell/azure/install-az-ps). To determine the version of the Az module installed on your machine, run the following command from a PowerShell session.
|
||||
|
||||
```powershell
|
||||
Get-InstalledModule -Name Az
|
||||
|
||||
@@ -79,7 +79,7 @@ resource Server_Name_activeDirectory 'Microsoft.Sql/servers/administrators@2021-
|
||||
// Create the ContosoHR database//
|
||||
//////////////////////////////////
|
||||
|
||||
resource Database_Resource 'Microsoft.Sql/servers/databases@2021-02-01-preview' = {
|
||||
resource Database_Resource 'Microsoft.Sql/servers/databases@2021-08-01-preview' = {
|
||||
name: 'ContosoHR'
|
||||
parent: Server_Name_resource
|
||||
location: location
|
||||
@@ -109,7 +109,7 @@ resource StorageAccount_Resource 'Microsoft.Storage/storageAccounts@2021-08-01'
|
||||
|
||||
//Grant the server access to the storage account
|
||||
var roleDefinitionId = 'ba92f5b4-2d11-453d-a403-e96b0029c9fe' // this is Storage Blob Data Contributor's GUID from https://docs.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#storage-blob-data-contributor
|
||||
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2021-04-01-preview' = {
|
||||
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2020-08-01-preview' = {
|
||||
name: guid(resourceGroup().id, resourceGroup().name, StorageAccount_var)
|
||||
scope: StorageAccount_Resource
|
||||
properties: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Import-Module "Az" -MinimumVersion "7.1.0"
|
||||
Import-Module "Az" -MinimumVersion "7.2.1"
|
||||
Import-Module "SqlServer" -MinimumVersion "21.1.18256"
|
||||
|
||||
######################################################################
|
||||
@@ -15,7 +15,7 @@ $sqlAdminPassword = (New-Object PSCredential "user",$sqlAdminPasswordSecureStrin
|
||||
$clientIP = (Invoke-WebRequest ifconfig.me/ip).Content.Trim()
|
||||
$bicepFile = "azuredeploy.bicep"
|
||||
$projectName = $projectName.ToLower()
|
||||
|
||||
$location = $location.ToLower()
|
||||
|
||||
######################################################################
|
||||
# Sign in to Azure
|
||||
|
||||
Reference in New Issue
Block a user