Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba masuk atau mengubah direktori.
Akses ke halaman ini memerlukan otorisasi. Anda dapat mencoba mengubah direktori.
Firewall Rules - Create Or Update
Layanan:
SQL Database
Versi API:
2023-08-01
Membuat atau memperbarui aturan firewall.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}?api-version=2023-08-01
Parameter URI
Nama
Dalam
Diperlukan
Jenis
Deskripsi
firewallRuleName
path
True
string
Nama aturan firewall.
resourceGroupName
path
True
string
Nama grup sumber daya yang berisi sumber daya. Anda dapat memperoleh nilai ini dari API Azure Resource Manager atau portal.
serverName
path
True
string
Nama server.
subscriptionId
path
True
string
ID langganan yang mengidentifikasi langganan Azure.
api-version
query
True
string
Versi API yang akan digunakan untuk permintaan tersebut.
Isi Permintaan
Nama
Jenis
Deskripsi
name
string
Nama sumber daya.
properties.endIpAddress
string
Alamat IP akhir aturan firewall. Harus format IPv4. Harus lebih besar dari atau sama dengan startIpAddress. Gunakan nilai '0.0.0.0' untuk semua alamat IP internal Azure.
properties.startIpAddress
string
Alamat IP awal aturan firewall. Harus format IPv4. Gunakan nilai '0.0.0.0' untuk semua alamat IP internal Azure.
400 ManagedInstanceStoppingOrStopped - Operasi yang bertentangan dikirimkan saat instans dalam status berhenti/dihentikan
400 ManagedInstanceStarting - Operasi bertentangan yang dikirimkan saat instans dalam status mulai
400 InvalidResourceId - Pengidentifikasi sumber daya tidak valid.
400 MismatchingSubscriptionWithUrl - Langganan yang disediakan tidak cocok dengan langganan di Url.
400 MismatchingResourceGroupNameWithUrl - Nama grup sumber daya yang disediakan tidak cocok dengan nama di Url.
400 MismatchingServerNameWithUrl - Nama server yang disediakan tidak cocok dengan nama di Url.
400 InvalidServerFirewallRuleResourceRequest - Permintaan sumber daya aturan firewall server tidak valid.
400 InvalidServerFirewallRuleResourceParameters - Parameter sumber daya aturan firewall server tidak valid.
400 FirewallRuleNotIPv4Address - Alamat aturan firewall yang disediakan bukan IPv4
400 TooManyFirewallRules - Aturan firewall yang disediakan melebihi batas.
400 FirewallRuleInvalidRange - Rentang aturan firewall yang ditentukan tidak valid.
400 FirewallRuleNameTooLong - Nama aturan firewall yang disediakan terlalu panjang
400 FirewallRuleNameEmpty - Nama aturan firewall yang disediakan kosong
400 DenyPublicEndpointEnabled - Tidak dapat membuat atau mengubah aturan firewall saat antarmuka jaringan publik untuk server dinonaktifkan. Untuk mengelola aturan firewall tingkat server atau database, aktifkan antarmuka jaringan publik.
400 FirewallRuleNameInvalid - Nama aturan firewall yang disediakan berisi karakter khusus.
404 ServerNotInSubscriptionResourceGroup - Server yang ditentukan tidak ada di grup sumber daya dan langganan yang ditentukan.
404 SubscriptionDoesNotHaveServer - Server yang diminta tidak ditemukan
429 SubscriptionTooManyRequests - Permintaan di luar permintaan maks yang dapat diproses oleh sumber daya yang tersedia.
429 SubscriptionTooManyCreateUpdateRequests - Permintaan di luar permintaan maks yang dapat diproses oleh sumber daya yang tersedia.
503 TooManyRequests - Permintaan di luar permintaan maks yang dapat diproses oleh sumber daya yang tersedia.
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/FirewallRuleCreate.json
// this example is just showing the usage of "FirewallRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "firewallrulecrudtest-12";
string serverName = "firewallrulecrudtest-6285";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this SqlFirewallRuleResource
SqlFirewallRuleCollection collection = sqlServer.GetSqlFirewallRules();
// invoke the operation
string firewallRuleName = "firewallrulecrudtest-5370";
SqlFirewallRuleData data = new SqlFirewallRuleData
{
StartIPAddress = "0.0.0.3",
EndIPAddress = "0.0.0.3",
};
ArmOperation<SqlFirewallRuleResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, firewallRuleName, data);
SqlFirewallRuleResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SqlFirewallRuleData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Sql;
// Generated from example definition: specification/sql/resource-manager/Microsoft.Sql/stable/2023-08-01/examples/FirewallRuleUpdate.json
// this example is just showing the usage of "FirewallRules_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this SqlServerResource created on azure
// for more information of creating SqlServerResource, please refer to the document of SqlServerResource
string subscriptionId = "00000000-1111-2222-3333-444444444444";
string resourceGroupName = "firewallrulecrudtest-12";
string serverName = "firewallrulecrudtest-6285";
ResourceIdentifier sqlServerResourceId = SqlServerResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, serverName);
SqlServerResource sqlServer = client.GetSqlServerResource(sqlServerResourceId);
// get the collection of this SqlFirewallRuleResource
SqlFirewallRuleCollection collection = sqlServer.GetSqlFirewallRules();
// invoke the operation
string firewallRuleName = "firewallrulecrudtest-3927";
SqlFirewallRuleData data = new SqlFirewallRuleData
{
StartIPAddress = "0.0.0.1",
EndIPAddress = "0.0.0.1",
};
ArmOperation<SqlFirewallRuleResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, firewallRuleName, data);
SqlFirewallRuleResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
SqlFirewallRuleData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
Alamat IP akhir aturan firewall. Harus format IPv4. Harus lebih besar dari atau sama dengan startIpAddress. Gunakan nilai '0.0.0.0' untuk semua alamat IP internal Azure.
properties.startIpAddress
string
Alamat IP awal aturan firewall. Harus format IPv4. Gunakan nilai '0.0.0.0' untuk semua alamat IP internal Azure.