autoshut down vm using azure sdk fluent c sharp

this is my code to create vm in azure using azure sdk fluent my question is i need to set auto shutdown option while creating vm i need to set the time while creating the vm so in that case the vm will get poweroff when the time arrives is that possible pls let me know if possible ??

    public async Task<VmResponse> DoCreateVm(VMConfigurationParameter objvm)
        {
            VmResponse response = new VmResponse();
            LogDAL objlog = new LogDAL();
            var usernameWithoutSpaces = objvm.UserName.Replace(" ", "");
            var vNetName = $"{char.ToUpper(usernameWithoutSpaces.Replace(".", "")[0])}{usernameWithoutSpaces.Replace(".", "").Substring(1, Math.Min(5, usernameWithoutSpaces.Replace(".", "").Length - 1))}{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}-vnet";
            var vNetAddress = "172.16.0.0/16";
            var subnetName = "default";
            var subnetAddress = "172.16.0.0/24";
            var nicName = $"{char.ToUpper(objvm.UserName.Replace(" ", "").Replace(".", "")[0])}{objvm.UserName.Replace(" ", "").Replace(".", "").Substring(1, Math.Min(5, objvm.UserName.Replace(" ", "").Length - 1))}{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}";
            var publicIPName = $"{char.ToUpper(objvm.UserName.Replace(" ", "").Replace(".", "")[0])}{objvm.UserName.Replace(" ", "").Replace(".", "").Substring(1, Math.Min(5, objvm.UserName.Replace(" ", "").Length - 1))}{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}";
            var nsgName = $"{char.ToUpper(objvm.UserName.Replace(" ", "").Replace(".", "")[0])}{objvm.UserName.Replace(" ", "").Replace(".", "").Substring(1, Math.Min(5, objvm.UserName.Replace(" ", "").Length - 1))}{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}";
            var username = $"{char.ToUpper(objvm.UserName.Replace(" ", "").Replace(".", "")[0])}{objvm.UserName.Replace(" ", "").Replace(".", "").Substring(1, Math.Min(5, objvm.UserName.Replace(" ", "").Length - 1))}{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}";
            var userpassword = $"{char.ToUpper(objvm.UserName.Replace(" ", "").Replace(".", "")[0])}{objvm.UserName.Replace(" ", "").Replace(".", "").Substring(1, Math.Min(5, objvm.UserName.Replace(" ", "").Length - 1))}@{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}";
            var vmname = $"{char.ToUpper(objvm.UserName.Replace(" ", "").Replace(".", "")[0])}{objvm.UserName.Replace(" ", "").Replace(".", "").Substring(1, Math.Min(5, objvm.UserName.Replace(" ", "").Replace(".", "").Length - 1))}{objvm.UserNumber.ToString().Substring(Math.Max(0, objvm.UserNumber.ToString().Length - 6))}-VM";

            try
            {
                
                    string filePath = ConfigurationManager.AppSettings["Credentials"];
                    var credentials = SdkContext.AzureCredentialsFactory.FromFile(filePath);
                    filePath = string.Empty;
                    var azure = Azure.Authenticate(credentials).WithDefaultSubscription();
                    string vm_ResGroup = "SSIS_Student"; 
                    var resourceGroupName = await DoGetResourceGroupName(azure, vm_ResGroup);
                    var details_resgrp = await DoGetResourceGroupName(azure, objvm.ExamName); //getting main details from the main resource group
                    var (galleryname, imagename) = await DoGetGalleryImageDetails(azure, objvm.ExamName);
                    if (resourceGroupName != "" && galleryname != "" && imagename != "" && details_resgrp!="")
                    {
                        var captureImage = azure.GalleryImages.GetByGallery(details_resgrp, galleryname, imagename);
                    if (captureImage != null)
                    {
                        //var security = captureImage.RecommendedVirtualMachineConfiguration;

                        //var regionName = await getRegion();
                        var network = azure.Networks.Define(vNetName)
                                .WithRegion(captureImage.Location)
                                .WithExistingResourceGroup(resourceGroupName)
                                .WithAddressSpace(vNetAddress)
                                .WithSubnet(subnetName, subnetAddress)
                                .Create();
                        var nsg = azure.NetworkSecurityGroups.Define(nsgName)
                            .WithRegion(captureImage.Location)
                            .WithExistingResourceGroup(resourceGroupName)
                            .DefineRule("Allow-RDP")
                                .AllowInbound()
                                .FromAnyAddress()
                                .FromAnyPort()
                                .ToAnyAddress()
                                .ToPort(3389)
                                .WithProtocol(SecurityRuleProtocol.Tcp)
                                .WithPriority(100)
                                .Attach()
                            .Create();
                        var publicIP = azure.PublicIPAddresses.Define(publicIPName)
                                .WithRegion(captureImage.Location)
                                .WithExistingResourceGroup(resourceGroupName)
                                .WithStaticIP()
                                .Create();
                        //You need a network security group for controlling the access to the VM

                        var nic = azure.NetworkInterfaces.Define(nicName)
                                 .WithRegion(captureImage.Location)
                                 .WithExistingResourceGroup(resourceGroupName)
                                 .WithExistingPrimaryNetwork(network)
                                 .WithSubnet(subnetName)
                                 .WithPrimaryPrivateIPAddressDynamic()
                                 .WithExistingPrimaryPublicIPAddress(publicIP)
                                 .WithExistingNetworkSecurityGroup(nsg)
                                 .Create();

                        //var security = security

                        var newVM = azure.VirtualMachines.Define(vmname)
                            
                                                         .WithRegion(captureImage.Location)
                                                         
                                                         .WithExistingResourceGroup(resourceGroupName)
                                                         
                                                         .WithExistingPrimaryNetworkInterface(nic)
                                                         
                                                         .WithWindowsCustomImage(captureImage.Id)
                                                         
                                                         .WithAdminUsername(username)
                                                         
                                                         .WithAdminPassword(userpassword)
                                                         
                                                         .WithComputerName(vmname)
                                                         
                                                         .WithSize(VirtualMachineSizeTypes.StandardD4sV3)
                                                         
                                                         .Create();
                        // newVM.Restart();

                        response.responseCode = "200";
                        response.responseMessage = "VM Created";
                        response.ipAddress = publicIP.Inner.IpAddress.ToString();
                        response.userName = username;
                        response.userPassword = userpassword;
                        response.vmname = vmname;
                        response.region = newVM.RegionName;
                        response.vmId = newVM.Id;


                        if (newVM != null)
                        {
                            DateTime shutdown = DateTime.Now.AddHours(4);
                            ScheduleShutdown(newVM.Id, shutdown, azure);
                        }

                        }
                        else
                        {
                            response.responseCode = "100";
                            response.responseMessage = "VM Not able to create";
                        }
                    }
                    else
                    {
                        response.responseCode = "400";
                        response.responseMessage = "Resource-Group , Image Not exist";
                    }
                }           
            catch (Exception ex)
            {
                var message = ex.Message.ToString();
                //objlog.LogExceptionToFile(message);
                response.responseCode = "500";
                response.responseMessage = message;

            }
            return response;
        }

i need to solution to autoshut down while creating vm using azure sdk fluent c sharp

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật