Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.22k stars 3.83k forks source link

Change or manage existing schedule timing using Powershell runbook #19415

Open R-LIBIN opened 2 years ago

R-LIBIN commented 2 years ago

Description

Hello Team ,

Kindly provide a way to change a existing update management schedule using PowerShell runbook in an automation account.

This is a requirement for our enterprise applications.

Let us know a way to provide an implementation for the same.

Thank you.

Regards , Libin

Script or Debug output

No response

Environment data

No response

Module versions

No response

Error output

No response

ghost commented 2 years ago

Thank you for your feedback. This has been routed to the support team for assistance.

navba-MSFT commented 2 years ago

@R-LIBIN Apologies for the late reply. Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.

navba-MSFT commented 2 years ago

@R-LIBIN The Set-AzAutomationSchedule PS cmdlet which can be used to modify an Automation schedule. Hope this helps.

R-LIBIN commented 2 years ago

https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationschedule?view=azps-8.3.0#examples

I don't see timings change in it. It's surprising 🤔. Do you have entire command as an example.

On Fri, 9 Sep, 2022, 11:58 am navba-MSFT, @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN The Set-AzAutomationSchedule https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationschedule?view=azps-8.3.0 PS cmdlet which can be used to modify an Automation schedule. Hope this helps.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1241553660, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFMI2JDWW5M6R2DKS53V5LKIXANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>

navba-MSFT commented 2 years ago

@R-LIBIN Thanks for getting back. Is your timings defined within variable ? If yes, did you check Set-AzAutomationVariable ? This cmdlet modifies the value or description of a variable in Azure Automation. To encrypt the variable, specify the Encrypted parameter. You cannot modify the encrypted state of a variable after creation. Specifying Encrypted for an existing, non-encrypted, variable fails.

R-LIBIN commented 2 years ago

Yes, @nvba the value would be going through a variable. We expect to run the schedule whenever required.

Thank you.

Thanks a lot for your support!.

Appreciate it.

Thank you.

Regards , Libin

On Fri, 9 Sep, 2022, 4:18 pm navba-MSFT, @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN Thanks for getting back. Is your timings defined within variable ? If yes, did you check Set-AzAutomationVariable https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationvariable?view=azps-8.3.0 ? This cmdlet modifies the value or description of a variable in Azure Automation. To encrypt the variable, specify the Encrypted parameter. You cannot modify the encrypted state of a variable after creation. Specifying Encrypted for an existing, non-encrypted, variable fails.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1241816013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFOCYZQ23DUTR3MKT6TV5MIWJANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>

R-LIBIN commented 2 years ago

We meant to say the start and end time should change on-demand. Any way. Any way-out?

On Fri, 9 Sep, 2022, 4:18 pm navba-MSFT, @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN Thanks for getting back. Is your timings defined within variable ? If yes, did you check Set-AzAutomationVariable https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationvariable?view=azps-8.3.0 ? This cmdlet modifies the value or description of a variable in Azure Automation. To encrypt the variable, specify the Encrypted parameter. You cannot modify the encrypted state of a variable after creation. Specifying Encrypted for an existing, non-encrypted, variable fails.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1241816013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFOCYZQ23DUTR3MKT6TV5MIWJANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>

navba-MSFT commented 2 years ago

@R-LIBIN

We meant to say the start and end time should change on-demand. Any way.

I am not sure if I understood this right. Could you please share your entire use-case scenario here and elaborate what you are trying to accomplish ?

Since you confirmed that the time value goes through variable. Did you try Set-AzAutomationVariable cmdlet ?

R-LIBIN commented 2 years ago

Let me check on it. While I am scratching my head. The relative meaning to the other command is not very clear. Reason being the only option is see in the set-schedule command is schedule name change.

Kindly correct me if I am wrong.

On Fri, 9 Sep, 2022, 4:52 pm navba-MSFT, @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN

We meant to say the start and end time should change on-demand. Any way. I am not sure if I understood this right. Could you please share your entire use-case scenario here and elaborate what you are trying to accomplish ?

Since you confirmed that the time value goes through variable. Did you try Set-AzAutomationVariable https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationvariable?view=azps-8.3.0 cmdlet ?

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1241848269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFIECXS5F6ERN775XK3V5MMYDANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>

navba-MSFT commented 2 years ago

@R-LIBIN Regarding your question related to Set-AzAutomationSchedule, You could do the following with this cmdlet too:

Set-AzAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule01" -Description "Automation Schedule" -ResourceGroupName "ResourceGroup01"

The above command modifies the description of the schedule named Schedule01.

Set-AzAutomationSchedule -AutomationAccountName $AutomationaccountName -Name "MySchedule3" -ResourceGroupName $resourcegroup -IsEnabled $false

To disable a schedule you can use the above command.

Set-AzAutomationSchedule -AutomationAccountName $AutomationaccountName -Name "MySchedule3" -ResourceGroupName $resourcegroup -IsEnabled $true

To enable a schedule you can use the above command.

Please let us know if you had a chance to test the PS cmdlet Set-AzAutomationVariable to update your timings variable. Awaiting our reply.

R-LIBIN commented 2 years ago

@navba-MSFT

I'll repeat. Hope, this makes it clear.

Basically, we have an existing schedule with everything defined.

All we need is to have the start time in schedule part of Update Management in an Automation Account to be changed on-demand.

You're understanding is right.

I tried to get a timings assuming the name in Schedule by Microsoft name to be "Starts"

PS /home/libin> Get-AzAutomationVariable -ResourceGroupName $ResourceGroup -AutomationAccountName $AutomationAccount -Name "Starts" Get-AzAutomationVariable: Cannot validate argument on parameter 'ResourceGroupName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.

tried setting the variable "Starts".

PS /home/libin> Set-AzAutomationVariable -ResourceGroupName $ResourceGroup -AutomationAccountName $AutomationAccount -Name "Starts"-Value "09/14/2022"

cmdlet Set-AzAutomationVariable at command pipeline position 1 Supply values for the following parameters: (Type !? for Help.) Encrypted: False Set-AzAutomationVariable: The variable was not found. Variable name Starts.

I am very much not sure what Automation Variable has to do with the timigs. Just tried from my side. Correct me if i am wrong.

Turns out the variable doesn't exist to change.

Can u help me and illustrate me with the syntax.

Thank you.

Regards , Libin

On Fri, Sep 9, 2022 at 4:52 PM navba-MSFT @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN

We meant to say the start and end time should change on-demand. Any way. I am not sure if I understood this right. Could you please share your entire use-case scenario here and elaborate what you are trying to accomplish ?

Since you confirmed that the time value goes through variable. Did you try Set-AzAutomationVariable https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationvariable?view=azps-8.3.0 cmdlet ?

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1241848269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFIECXS5F6ERN775XK3V5MMYDANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>

R-LIBIN commented 2 years ago

@navba-MSFT

I mean to say the patch update management schedule where we need to update the start variable.

On Mon, Sep 12, 2022 at 10:30 AM navba-MSFT @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN Regarding your question related to Set-AzAutomationSchedule https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationschedule?view=azps-8.3.0, You could do the following with this cmdlet too:

Set-AzAutomationSchedule -AutomationAccountName "Contoso17" -Name "Schedule01" -Description "Automation Schedule" -ResourceGroupName "ResourceGroup01"

The above command modifies the description of the schedule named Schedule01.

Set-AzAutomationSchedule -AutomationAccountName $AutomationaccountName -Name "MySchedule3" -ResourceGroupName $resourcegroup -IsEnabled $false

To disable a schedule you can use the above command.

Set-AzAutomationSchedule -AutomationAccountName $AutomationaccountName -Name "MySchedule3" -ResourceGroupName $resourcegroup -IsEnabled $true

To enable a schedule you can use the above command.

Please let us know if you had a chance to test the PS cmdlet Set-AzAutomationVariable https://docs.microsoft.com/en-us/powershell/module/az.automation/set-azautomationvariable?view=azps-8.3.0 to update your timings variable. Awaiting our reply.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1243222791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFOHX5DAN55PP7SMAP3V522HVANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>

navba-MSFT commented 2 years ago

@R-LIBIN Thanks for clarifying your ask. I will add the Service team to look into this and assist you further.

If this issue is very critical and if you need immediate assistance feel free to open a support ticket and our support professionals would be happy to help you on this.

ghost commented 2 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jaspkaur28.

Issue Details
### Description Hello Team , Kindly provide a way to change a existing update management schedule using PowerShell runbook in an automation account. This is a requirement for our enterprise applications. Let us know a way to provide an implementation for the same. Thank you. Regards , Libin ### Script or Debug output _No response_ ### Environment data _No response_ ### Module versions _No response_ ### Error output _No response_
Author: R-LIBIN
Assignees: -
Labels: `Automation`, `Service Attention`, `question`, `customer-reported`, `needs-team-attention`
Milestone: -
R-LIBIN commented 2 years ago

The problem here is it is a product question and the free adaptability of new requirements. Secondly, we can't afford cost for this.

It is is quiet is quiet important that cmdlet( Not for all)/ the programming should have acces to every component/ services in Azure that is under use of the person is authorised to do so. But, see very few options in Azure Environment that are programmable. We wish to see the Azure in greater heights. Only thing, we see general cases attainable through and for far -fetched Advanced things unattainable. I think these are under development.

Thanks a lot @navba-MSFT.

The reason we use schedule is that it is already configured. All we need to run ( trigger)/ change time and trigger on that time on -demand.

On Thu, 15 Sep, 2022, 10:48 am navba-MSFT, @.***> wrote:

@R-LIBIN https://github.com/R-LIBIN Thanks for clarifying your ask. I will add the Service team to look into this and assist you further.

If this issue is very critical and if you need immediate assistance feel free to open a support ticket and our support professionals would be happy to help you on this.

— Reply to this email directly, view it on GitHub https://github.com/Azure/azure-powershell/issues/19415#issuecomment-1247593457, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBCZFIRRH7PB5DU7PUQNUTV6KWQVANCNFSM6AAAAAAQF4ECQM . You are receiving this because you were mentioned.Message ID: @.***>