お世話になっております。
タイトルに記載の件についてお問い合わせになります。
よろしくお願いいたします。
下記のような「main.bicep」があります。
/*
param
*/
param location string = resourceGroup().location
@description('DBのadminパスワード。')
@secure()
param dbAdministratorLoginPassword string
/*
VNET
*/
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2024-05-01' = {
name: 'myapp-vnet'
location: location
properties: {
addressSpace: {
addressPrefixes: [
'10.0.0.0/16'
]
}
}
resource appSubnet 'subnets' = {
name: 'app-subnet'
properties: {
addressPrefix: '10.0.0.0/24'
delegations: [
{
name: 'app-delegation'
properties: {
serviceName: 'Microsoft.Web/serverFarms'
}
}
]
}
}
resource dbSubnet 'subnets' = {
name: 'db-subnet'
properties: {
addressPrefix: '10.0.1.0/24'
delegations: [
{
name: 'mysql-delegation'
properties: {
serviceName: 'Microsoft.DBforMySQL/flexibleServers'
}
}
]
}
}
}
/*
MySQL
*/
resource dbserver 'Microsoft.DBforMySQL/flexibleServers@2021-12-01-preview' = {
location: location
name: 'samplepjname'
sku: {
name: 'Standard_B1ms'
tier: 'Burstable' // Burstable,Generalpurpose,MemoryOptimized
}
properties: {
version: '8.4'
administratorLogin: 'samplepjname'
administratorLoginPassword: dbAdministratorLoginPassword
network: {
delegatedSubnetResourceId: virtualNetwork::dbSubnet.id
}
}
}
resource database 'Microsoft.DBforMySQL/flexibleServers/databases@2021-12-01-preview' = {
parent: dbserver
name: 'myapp-database'
properties: {
charset: 'utf8'
collation: 'utf8_general_ci'
}
}
/*
AppServices
*/
resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
name: 'myapp-appserviceplan'
location: location
sku: {
name: 'B1'
}
kind: 'linux'
properties: {
reserved: true
}
}
resource webApp 'Microsoft.Web/sites@2024-11-01' = {
name: uniqueString(resourceGroup().id)
location: location
properties: {
serverFarmId: appServicePlan.id
siteConfig: {
acrUseManagedIdentityCreds: true
linuxFxVersion: 'sitecontainers'
appSettings: [
{
name: 'DB_PASSWORD'
value: dbAdministratorLoginPassword
}
]
ipSecurityRestrictions: [
{
name: 'somewhere'
action: 'Allow'
ipAddress: '123.123.123.123/32'
}
]
}
virtualNetworkSubnetId: virtualNetwork::appSubnet.id
}
identity: {
type: 'SystemAssigned'
}
}
resource webAppSiteContainerMain 'Microsoft.Web/sites/sitecontainers@2024-11-01' = {
parent: webApp
name: 'main'
properties: {
authType: 'SystemIdentity'
image: 'samplepjname.azurecr.io/samplepjname:samplepjname'
isMain: true
targetPort: '8888'
}
}
/*
ACR
*/
resource acrResource 'Microsoft.ContainerRegistry/registries@2023-06-01-preview' existing = {
name: 'samplepjname'
}
resource acrPullRoleDefinition 'Microsoft.Authorization/roleDefinitions@2022-05-01-preview' existing = {
scope: acrResource
name: '7f951dda-4ed3-4680-a7ca-43fe172d538d' // 秘匿値ではない。https://learn.microsoft.com/ja-jp/azure/role-based-access-control/built-in-roles#containers
}
var webAppPrincipalId = webApp.identity.principalId
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(acrResource.id, webApp.id, acrPullRoleDefinition.id)
scope: acrResource
properties: {
principalId: webAppPrincipalId
roleDefinitionId: acrPullRoleDefinition.id
principalType: 'ServicePrincipal'
}
}
これを「Japan East」にデプロイするため、以下コマンドを試みました。
az group create --name sampleresourcegroup --location "japaneast"
az deployment group create \
--resource-group sampleresourcegroup \
--template-file main.bicep
結果、以下のエラーとなりました。
{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/xxx-xxx-xxx-xxx-xxx/resourceGroups/samplepjname/providers/Microsoft.Resources/deployments/main","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/xxx-xxx-xxx-xxx-xxx/resourceGroups/samplepjname/providers/Microsoft.DBforMySQL/flexibleServers/samplepjname","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"ProvisionNotSupportedForRegion","message":"Provisioning in requested region is not supported. Your subscription might not have access to create a server in the selected region. (https://aka.ms/mysqlcapacity)"}]}]}}
エラーに記載されておりますドキュメントより、以下に行きつきました。
https://learn.microsoft.com/en-us/azure/mysql/flexible-server/resolve-capacity-errors?tabs=portal#enable-region
Enable region
Error message(s):
- Provisioning in the requested region isn't supported.
Your subscription might not have access to create a server in the selected region.
Resolution: File a support request to gain access to the selected region.
サポート問い合わせで解決できるとのことで、本問い合わせに至ります。
以上、どうぞよろしくお願いいたします。