0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【AzureCLI トラブルシューティング】Code: LinkedInvalidPropertyId

Last updated at Posted at 2023-09-22

AzureCLI トラブルシューティング

ACR1Id=$(az acr show --name acr1 --query 'id' --output tsv)
az network private-endpoint create --name endpoint1 --resource-group resourcegroup1 --vnet-name vnet1 --subnet subnet1 --connection-name connection1 --private-connection-resource-id $ACR1Id --group-ids registry

を実行したとき、下記エラーが出た。

' at path 'properties.privateLinkServiceConnections[0].properties.privateLinkServiceId' is invalid. Expect fully qualified resource Id that start with '/subscriptions/{subscriptionId}' or '/providers/{resourceProviderNamespace}/'.
Code: LinkedInvalidPropertyId

原因

コマンドに--debugを付けて原因を特定した。
変数の値の末尾に\rが付いていた。

Command arguments: ['network', 'private-endpoint', 'create', '--name', 'endpoint1', '--resource-group', 'resourcegroup1', '--vnet-name', 'vnet1', '--subnet', 'subnet1', '--connection-name', 'connection1', '--private-connection-resource-id', '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourcegroup1/providers/Microsoft.ContainerRegistry/registries/acr1\r', '--group-ids', 'registry', '--debug']

変数代入時にtrコマンドで\rを除去してaz network private-endpoint createに成功した。

ACR1Id=$(az acr show --name $ACR1Name --query 'id' --output tsv | tr -d '\r')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?