Skip to content

Commit

Permalink
Public IP Address Standard IP SKU Default
Browse files Browse the repository at this point in the history
  • Loading branch information
JenGoldstrich committed Oct 29, 2024
1 parent 6c21022 commit cc699c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions builder/azure/arm/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
if b.config.ClientConfig.ObjectID == "" && b.config.OSType != constants.Target_Linux {
return nil, fmt.Errorf("could not determine the ObjectID for the user, which is required for Windows builds")
}
publicIPWarning := "On March 31, 2025, Azure will no longer allow the creation of public IP addresses with a Basic SKU, which is the default SKU type for this builder. You are seeing this warning because this build will create a new temporary public IP address using the `Basic` sku. You can remove this warning by setting the standard public IP SKU (`public_ip_sku`) field to `Standard`. This builder will update its default value from `Basic` to `Standard` in a future release closer to Azure’s removal date. You can learn more about this change in the official Azure announcement https://azure.microsoft.com/en-us/updates/upgrade-to-standard-sku-public-ip-addresses-in-azure-by-30-september-2025-basic-sku-will-be-retired/."
publicIPWarning := "On March 31, 2025, Azure will no longer allow the creation of public IP addresses with a Basic SKU, this builder has been updated to use Standard IP SKUs by default. You are seeing this warning because this build will create a new temporary public IP address using the `Basic` sku. You can remove this warning by setting the standard public IP SKU (`public_ip_sku`) field to `Standard`,or simply don't set public_ip_sku, as its default is standard. You can learn more about this change in the official Azure announcement https://azure.microsoft.com/en-us/updates/upgrade-to-standard-sku-public-ip-addresses-in-azure-by-30-september-2025-basic-sku-will-be-retired/."
// If the user is bringing their own vnet, don't warn, if its an invalid SKU it will get disabled at a different date and Microsoft will send out warings
if b.config.VirtualNetworkName == "" {
if b.config.PublicIpSKU == "" || b.config.PublicIpSKU == string(publicipaddresses.PublicIPAddressSkuNameBasic) {
if b.config.PublicIpSKU == string(publicipaddresses.PublicIPAddressSkuNameBasic) {
ui.Message(publicIPWarning)
}
}
Expand Down
4 changes: 2 additions & 2 deletions builder/azure/arm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ type Config struct {
EncryptionAtHost *bool `mapstructure:"encryption_at_host" required:"false"`

// Specify the Public IP Address SKU for the public IP used to connect to the build Virtual machine.
// Valid values are `Basic` and `Standard`. The default value is `Basic`.
// On 31 March 2025 Azure will remove the ability to create `Basic` SKU public IPs, before then the plugin will be updated to create a Standard public IP by default
// Valid values are `Basic` and `Standard`. The default value is `Standard`.
// On 31 March 2025 Azure will remove the ability to create `Basic` SKU public IPs, we reccomend upgrading as soon as possible
// You can learn more about public IP SKUs [here](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses#sku)
PublicIpSKU string `mapstructure:"public_ip_sku" required:"false"`

Expand Down
3 changes: 2 additions & 1 deletion builder/azure/arm/template_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,8 @@ func GetVirtualMachineTemplateBuilder(config *Config) (*template.TemplateBuilder
}
}

if config.PublicIpSKU == "Standard" {
// Standard is the default, basic will no longer be supported in the future
if config.PublicIpSKU != "Basic" {
err = builder.SetPublicIPSKU("Standard", "Regional")
if err != nil {
return nil, err
Expand Down

0 comments on commit cc699c5

Please sign in to comment.